Imports Microsoft.VisualBasic
Imports System.Data.Common

Public Class MySqlParameter
    Inherits DbParameter

    Friend ReadOnly _param As MySql.Data.MySqlClient.MySqlParameter
    Private ReadOnly _type As MySql.Data.MySqlClient.MySqlDbType

    Sub New()

        Me._param = New MySql.Data.MySqlClient.MySqlParameter()
        Me._type = _param.MySqlDbType

    End Sub

    Sub New(ByVal param As MySql.Data.MySqlClient.MySqlParameter)

        Me._param = param
        Me._type = _param.MySqlDbType

    End Sub

    Public Overrides Property DbType() As System.Data.DbType
        Get
            Return Me._param.DbType
        End Get
        Set(ByVal value As System.Data.DbType)
            Me._param.DbType = value
        End Set
    End Property

    Public Overrides Property Direction() As System.Data.ParameterDirection
        Get
            Return Me._param.Direction
        End Get
        Set(ByVal value As System.Data.ParameterDirection)
            Me._param.Direction = value
        End Set
    End Property

    Public Overrides Property IsNullable() As Boolean
        Get
            Return Me._param.IsNullable
        End Get
        Set(ByVal value As Boolean)
            Me._param.IsNullable = value
        End Set
    End Property

    Public Overrides Property ParameterName() As String
        Get
            Return Me._param.ParameterName
        End Get
        Set(ByVal value As String)
            Me._param.ParameterName = value
        End Set
    End Property

    Public Overrides Sub ResetDbType()

        Me._param.DbType = Me._type

    End Sub

    Public Overrides Property Size() As Integer
        Get
            Return Me._param.Size
        End Get
        Set(ByVal value As Integer)
            Me._param.Size = value
        End Set
    End Property

    Public Overrides Property SourceColumn() As String
        Get
            Return Me._param.SourceColumn
        End Get
        Set(ByVal value As String)
            Me._param.SourceColumn = value
        End Set
    End Property

    Public Overrides Property SourceColumnNullMapping() As Boolean
        Get
            Return Me._param.IsNullable
        End Get
        Set(ByVal value As Boolean)
            Me._param.IsNullable = value
        End Set
    End Property

    Public Overrides Property SourceVersion() As System.Data.DataRowVersion
        Get
            Return Me._param.SourceVersion
        End Get
        Set(ByVal value As System.Data.DataRowVersion)
            Me._param.SourceVersion = value
        End Set
    End Property

    Public Overrides Property Value() As Object
        Get
            Return Me._param.Value
        End Get
        Set(ByVal value As Object)
            Me._param.Value = value
        End Set
    End Property
End Class
